﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;
using DIST.LR.ZHJG.Infrastructure;

namespace DIST.LR.ZHJG.Navigation
{
   [System.ComponentModel.DesignTimeVisible(false)]
    public partial class FloatNavigation : UserControl
    {
        private IModuleManager _moduleManager;
        private IRegionManager _regionManager;
        private FloatNaviViewModel viewmodel;
        public FloatNavigation(IModuleManager moduleManager, IRegionManager regionManager)
        {
            InitializeComponent();

            _moduleManager = moduleManager;
            _regionManager = regionManager;

            viewmodel = new FloatNaviViewModel();
            this.DataContext = viewmodel;
        }

        private void mainpage_Click(object sender, RoutedEventArgs e)
        {
            _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.DefaultSummary, UriKind.Relative));
        }

        private void glpage_Click(object sender, RoutedEventArgs e)
        {
            //_regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.Zygl_Nyd, UriKind.Relative));
        }

        private void pipage_Click(object sender, RoutedEventArgs e)
        {
            //_regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.P_Ddxz, UriKind.Relative));
        }

        private void gongpage_Click(object sender, RoutedEventArgs e)
        {
            //_regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.G_Gyyd, UriKind.Relative));
        }

        private void yongpage_Click(object sender, RoutedEventArgs e)
        {
            //_regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.Y_Jdjd, UriKind.Relative));
        }

        private void bupage_Click(object sender, RoutedEventArgs e)
        {
            //_regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.B_Gd, UriKind.Relative));
        }

        private void chapage_Click(object sender, RoutedEventArgs e)
        {
            //_regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.C_Jgwy, UriKind.Relative));
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button bt = sender as Button;
            switch (bt.Tag.ToString())
            {
                case "110":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.Zygl_Nyd, UriKind.Relative));
                    break;
                case "120":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.Zygl_Jsyd, UriKind.Relative));
                    break;
                case "210":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.P_Ys, UriKind.Relative));
                    break;
                case "220":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.P_Nzy, UriKind.Relative));
                    break;
                case "230":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.P_Ddxz, UriKind.Relative));
                    break;
                case "240":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.P_Qt, UriKind.Relative));
                    break;
                case "310":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.G_Zl, UriKind.Relative));
                    break;
                case "320":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.G_Jyxyd, UriKind.Relative));
                    break;
                case "330":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.G_Gyyd, UriKind.Relative));
                    break;
                case "340":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.G_Tdcb, UriKind.Relative));
                    break;
                case "350":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.G_Qt, UriKind.Relative));
                    break;
                case "410":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.Y_Jdjd, UriKind.Relative));
                    break;
                case "420":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.Y_Kgjd, UriKind.Relative));
                    break;
                case "430":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.Y_Jgjd, UriKind.Relative));
                    break;
                case "440":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.Y_Ysjd, UriKind.Relative));
                    break;
                case "450":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.Y_Tddj, UriKind.Relative));
                    break;
                case "460":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.Y_Qt, UriKind.Relative));
                    break;
                case "510":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.B_Gd, UriKind.Relative));
                    break;
                case "520":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.B_Kfk, UriKind.Relative));
                    break;
                case "530":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.B_Tdzz, UriKind.Relative));
                    break;
                case "610":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.C_Kgwy, UriKind.Relative));
                    break;
                case "620":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.C_Xzdc, UriKind.Relative));
                    break;
                case "630":
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.C_Jgwy, UriKind.Relative));
                    break;
                default:
                    _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.Common, UriKind.Relative));
                    break;
            }
        }

        private void gongpage_Click_1(object sender, RoutedEventArgs e)
        {
            _regionManager.RequestNavigate(RegionNames.ModuleRegion, new Uri(ViewNames.G_Summary, UriKind.Relative));

        }
    }
}
